home *** CD-ROM | disk | FTP | other *** search
- Path: access1.digex.net!not-for-mail
- From: ell@access1.digex.net (Ell)
- Newsgroups: comp.lang.c++
- Subject: Re: Pure Virtual Destructor Question
- Date: 18 Feb 1996 00:10:18 GMT
- Organization: The Universe
- Message-ID: <4g5qpa$lhk@news4.digex.net>
- References: <4fas7a$7ns@comet2.magicnet.net> <4fecq0$k4e@news4.digex.net> <rcauvin-0902960901140001@quadostimpy.natinst.com> <4fp5r2$dm2@news4.digex.net> <4g2lpo$f81@druid.borland.com>
- NNTP-Posting-Host: access1.digex.net
- X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
-
- Pete Becker (pete@borland.com) wrote:
- : In article <4fp5r2$dm2@news4.digex.net>, ell@access1.digex.net says...
- : >
- : >Roger L. Cauvin (rcauvin@natinst.com) wrote:
- : >: In article <4fecq0$k4e@news4.digex.net>, ell@access4.digex.net (Ell) wrote:
- : >:
- : >: >It is _illegal_ to logically, or physically "define" a pure
- : >: > virtual function in the class it is "declared" in. A pure virtual should
- : >: > only be defined in classes derived from the class where the pure virtual
- : >: > is declared. Only derived classes should "do some destructor stuff".
- : >:
- : >: Actually, it is acceptable to define a pure virtual function in the class
- : >: in which it is declared. Pure virtual destructors are a special case;
- : >: they MUST be defined in the class in which they are declared.
- : >
- : >Yes, a pure virtual dtor MUST be _defined_ as a member of the class it is
- : >declared in. As dtors are not inherited by derived classes, the only
- : >place to override the pure virtual declaration for a class is as a member
- : >of the class (though it must actually be defined outside of the class
- : >declaration).
- : >
- :
- : The issue is not whether you have a place to override it. The issue is
- : whether
- : it is actually called.
-
- It seems to me that regardless of it actually being called, there is no
- other place to define a pure virtual dtor, but as a member outside of the
- class it is declared in.
-
- : >Still a class with a single pure virtual declaration, such as a pure
- : >virtual dtor declaration is considered to be 'abstract' even with the
- : >"outside of class declaration" definition of the pure virtual dtor.
-
- : Yes, but this is just a specific example of the general rule that any class
- : with a pure virtual function is abstract, even if you provide a definition
- : for
- : that function.
-
- That seems to me to be what I just said above this.
-
- Elliott
-
-